package fr.jade.reflex.api.control;

import org.objectweb.fractal.api.Component;

/**
 * The meta controller interface defines getter/setter method to manage component 
 * reference between the exec level and the metalevel.
 * 
 * @author nono
 * @contact noel.depalma@inrialpes.fr
 * 
 * modified : 16/5/5 Fabienne Boyer
 * add the following public attributes
 *   - NO_LEVEL
 *   - EXEC_LEVEL
 *   - META_LEVEL
 * add the following public methods : 
 *   - setLevel
 *   - getLevel
 */

public interface ReflexController {

	 /**
	  * level of the component to which this controller is assigned :
	  *  NO_LEVEL : level not assigned
	  *  EXEC_LEVEL : the execution level
	  *  META_LEVEL : the meta level
	  */
	 
	 public static final String NO_LEVEL = "undefined";
	 public static final String EXEC_LEVEL = "execution";
	 public static final String META_LEVEL = "meta";
  
  /**
  * set the reference of the dual component :
   * (reference of the associated component at the execution level if this 
   * component is at the meta level, reference of the associated component at the 
   * meta level if this component is at the execution level.
   * @param ref the ref of the dual component 
   *    
  */
  void setCmpRef (Component ref);
  
  /**
   * return the reference of the dual component :
   * (reference of the associated component at the execution level if this 
   * component is at the meta level, reference of the associated component at the 
   * meta level if this component is at the execution level.
   * @return the ref of the dual component 
   */
  Component getCmpRef ();  
  
  /**
   * set the level of this component 
   * @param level the level of the component 
   *    
   */
  void setLevel (String level);
  
  /**
   * return the level of this component 
   * @return the level of the component 
   */
  String getLevel ();  
  
  /**
   * Set a predefined reflex attribute.
   * @param name the name of the attribute to set.
   * @param value the value of the attribute.
   */
  void setReflexAttribute(String name, String value);
  
  /**
   * Get a predefined reflex attribute.
   * @param name the name of the attribute to set.
   * @return the value of the attribute.
   */
  String getReflexAttribute(String name);
}